package com.henu.engineer.controller.teacher.cl

import com.henu.engineer.service.FileService
import com.henu.engineer.service.LoginService
import com.henu.engineer.service.teacher.cl.CourseOutlineCLService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import org.springframework.web.multipart.MultipartFile

/**
 *
 * @author noexcept
 * @since 2021/8/13 11:04
 */
@RestController
@RequestMapping("/cl")
class CourseOutlineCLController {

    @Autowired
    lateinit var fileService: FileService

    @Autowired
    lateinit var courseOutlineCLService: CourseOutlineCLService

    @Autowired
    lateinit var loginService: LoginService


    /**
     * 上传课程大纲      uploadTeacherId为当前登录的老师ID  这个应该在后端也能得到 不知道怎样得到
     */
    @PostMapping("/courseUpload")
    fun courseOutline(fileUpload: MultipartFile?): String{
        val uploadTeacherId=loginService.currentUserId
       return courseOutlineCLService.courseOutline(uploadTeacherId,fileUpload)
    }


    /**
     * 试卷审批表上传
     */
    @PostMapping("/testUpload")
    fun testAudit(fileUpload: MultipartFile?): String{
        val uploadTeacherId=loginService.currentUserId
        return courseOutlineCLService.testOutline(uploadTeacherId,fileUpload)
    }



}